/* ------------------------------------------------------------------------
 * Copyright (c) 2024-2025 [XD-AMCC TEAM]
 * [XD-AMCC] is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *        http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES
 * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
 * TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 ----------------------------------------------------------------------- */


/**
 * @file
 * @brief Configuration header for Another-Micro-C Compiler.
 *
 * This file was created according to "amcc_config.h.in".
 *
 * @author  WXQ#XDU
 * @date    2024.11
 */

#pragma once

#ifndef AMCC_CONFIG_H_IN
#define AMCC_CONFIG_H_IN


#define AMCC_ARG2ID(head, body)  head##body

#define AMCC_ARG2STR(n)  AMCC_MKSTR__(n)
#define AMCC_MKSTR__(s)  #s

#define AMCC_PRJ_NAME        "AMCC"
#define AMCC_PRJ_FULLNAME    "Another-Micro-C Compiler"
#define AMCC_VERSION_MAJOR   1
#define AMCC_VERSION_MINOR   0
#define AMCC_VERSION_PATCH   0

#define AMCC_VERSION_STRING  "1.0.0"


// which compiler ?
#if  defined __GNUC__
    #define  AMCC_BY_GNU  1     // compiler is gcc of GNU
    #define  AMCC_BY_NAME "GCC"
    #define  AMCC_BY_VER  (__GNUC__ * 100 + __GNUC_MINOR__)
//   #define  AMCC_BY_VERSTR AMCC_ARG2STR(__GNUC__) "." AMCC_ARG2STR(__GNUC_MINOR__)
    #define  AMCC_BY_VERSTR __VERSION__
#elif defined _MSC_VER
    #define  AMCC_BY_MSVC 1     // comipler is MS-VC++
    #define  AMCC_BY_NAME "MSVC"
    #define  AMCC_BY_VER  (_MSC_VER)
    #define  AMCC_BY_VERSTR AMCC_ARG2STR(_MSC_VER)
#else
    #error "AMCC must be built using GCC or MSVC"
#endif


#define DIR_OUTPUT_DFT      "amcc-out"          // dir-name of output files
#define FN_LOGFILE_DFT      "amcc.log"          // log file name
#define FN_TOKENFILE_DFT    "tokens.txt"        // token file name
#define FN_IRCODEFILE_DFT   "ircode.txt"        // intermediate code file name
#define FN_ARRINIT_FORMAT   "arrinit_%d_%d.txt" // init-value file name

#define FN_TREEFILE_DFT     "parsetree.xml"     // parse-tree file name
#define XML_NAMESPACE_TREE  "XDAMCC.TREE"
#define XML_XSD_TREE        "parsetree.xsd"

#define FN_SYMFILE_DFT      "symtable.xml"      // symbol-table file name
#define XML_NAMESPACE_SYMTBL "XDAMCC.SYMTBL"
#define XML_XSD_SYMTBL      "symtable.xsd"

#define FILEPATH_MAXSIZE    1024    // MAX-length of a  file path
#define EXPRTEXT_MAXLEN     500     // MAX-length of an expression


#define EPSILON_TEXT        "EPSILON"  // show what for the Epsilon


#ifdef __cplusplus
#define AMCC_DECL_BEGIN extern "C" {
#define AMCC_DECL_END   }
#else
#define AMCC_DECL_BEGIN
#define AMCC_DECL_END
#endif


#include "_bootcfg.h"

#endif // AMCC_CONFIG_H_IN
